package com.lianxueda.drawing.mapper;

import com.lianxueda.drawing.domain.pojo.CourseStudent;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lianxueda.drawing.domain.pojo.Courses;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author 29264
* @description 针对表【course_student】的数据库操作Mapper
* @createDate 2024-08-26 14:49:05
* @Entity com.lianxueda.drawing.domain.pojo.CourseStudent
*/
@Mapper
public interface CourseStudentMapper extends BaseMapper<CourseStudent> {



    List<Integer> selectCourseIdsByStudentId(@Param("studentId") Integer studentId);

        @Insert("INSERT INTO course_student (student_id, course_id) VALUES (#{ss}, #{dd})")
        Integer insertCourseStudent(@Param("ss") Integer studentId, @Param("dd") Integer courseId);


    List<CourseStudent> selectByCourseIds(@Param("courseIds") List<Integer> courseIds);

    List<Integer> getStudentIdsByCourseId(@Param("courseId")  Integer courseId);

    List<Integer> selectStudentsByCourseIds(@Param("courseIds")  List<Integer> courseIds);

    @Select("SELECT student_id FROM course_student WHERE course_id = #{courseId}")
    List<Integer> selectIdsById(@Param("courseId")  Integer courseId);
}




